<template>
  <div class="common-layout">
    <el-container>

      <el-header>
        <el-menu
            :default-active="activeIndex2"
            mode="horizontal"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
            router
        >
          <img id="logo" src="../../assets/logo.svg">
          <el-menu-item :index="'/front_home/work'">工作</el-menu-item>
          <el-menu-item :index="'/front_home/subsidy'">补贴</el-menu-item>
          <el-menu-item :index="'/front_home/apply'">申请</el-menu-item>
          <el-menu-item :index="'/front_home/me'">我的</el-menu-item>

          <el-menu-item>
            <el-button type="primary" style="background-color: #373d41" @click="logout">
            退出
            </el-button>
          </el-menu-item>
          <el-menu-item >
            欢迎使用精准扶贫系统！！！ 您可以对以下资源进行预约。
          </el-menu-item>
        </el-menu>
      </el-header>

      <el-main>
        <router-view/>
      </el-main>
      <el-footer><br>
        欢迎使用！ 如下是小星星!
        <el-rate v-model="value"
                 allow-half
                 show-score
                 :colors="['#409eff', '#67c23a', '#FF9900']"
                 score-template=" {value} 个"
        />
      </el-footer>
    </el-container>
  </div>
</template>
<script>
import { ref } from 'vue'

import router from "../../router/router";
//退出用户
function useLogout(){
  const logout = () => {
    localStorage.removeItem("token")
    console.log("删除toke")
    router.push("/login")
  }
  return {
    logout
  }
}
export default {
  setup(){
    const value = ref(4)
    return {
      value,
      ...useLogout(),
    };
  }
}
</script>
<style>
.el-container{
  height: 1000px;
}
.el-aside{
  background-color: #333744;
}
.el-main{
  background-color: #eaedf1;
}
.el-header{
  background-color: #373d41;
  color: #fff;
  font-size: 20px;
}
a{
  text-decoration: none;
  color: #fff;
}
.header-div img {
  vertical-align: middle;
  margin-right: 20px;
  width: 60px;
  height: 60px;
}
.toggle-button {
  background-color: #4a5064;
  font-size: 10px;
  line-height: 24px;
  color: #fff;
  text-align: center;
  letter-spacing: 0.2em;
  cursor: pointer;
}
.avatar_box {
  /*// 盒子高度130像素*/
  height: 40px;
  /*// 宽度130像素*/
  width: 40px;
  /*// 边框线1像素 实线*/
  border: 1px solid #eee;
  /*// 圆角*/
  border-radius: 50%;
  /*// 内padding*/
  /*// 添加阴影 向外扩散10像素 颜色ddd*/
  box-shadow: 0 0 10px #ddd;
  /*// 绝对定位*/
  position: absolute;
  /*// 距离左则*/
  left: 97%;
  /*// 位移*/
  transform: translate(-50%, -50%);
  /*// 背景*/
  background-color: #fff;
  /* 距离上边距 */
  margin-top: 10px;
}

.el-carousel__item h3 {
  color: #475669;
  font-size: 14px;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
  text-align: center;
}
#logo {
  vertical-align: middle;
  margin-right: 20px;
  width: 60px;
  height: 60px;
}
</style>
